<link rel="stylesheet" href="/assets/store/plugins/kindeditor/themes/default/default.css">
<link rel="stylesheet" href="/assets/store/plugins/tagsinput/amazeui.tagsinput.css">
<style>
.am-form .am-tagsinput {
    min-width: 100%;
  }
</style>
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <input type="hidden" name="doc[id]" value="<?php echo $info['id']; ?>" />
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">文章信息-编辑</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-2 am-form-label form-require">赛事 </label>
                                <div class="am-u-sm-10 am-u-end">
                                    <input type="text" class="tpl-form-input" name="doc[match]"
                                           value="<?php echo $info['match']; ?>" readOnly>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-2 am-form-label form-require">栏目 </label>
                                <div class="am-u-sm-10 am-u-end">
                                    <label class="am-form-label" style="color:red;">
                                        <input type="hidden" name="doc[category_id]" value="<?php echo $category['id']; ?>" />
                                        <?php echo $category['title']; ?>
                                    </label>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-2 am-form-label form-require">比赛双方 </label>
                                <div class="am-u-sm-10 am-u-end">
                                    
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-2 am-form-label form-require">标签 </label>
                                <div class="am-u-sm-10 am-u-end">
                                    <input id="tags-1" type="text" name="doc[tags]" value="<?php echo $info['tags']; ?>" data-role="tagsinput"/>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-2 am-form-label form-require">浏览量 </label>
                                <div class="am-u-sm-10 am-u-end">
                                    <input type="text" class="tpl-form-input" name="doc[view]"
                                           value="<?php echo $info['view']; ?>" required>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-2 am-form-label form-require">内容 </label>
                                <div class="am-u-sm-10 am-u-end">
                                    <!-- 加载编辑器的容器 -->
                                    <textarea id="container" name="doc[content]" style="height:350px;"><?php echo htmlspecialchars_decode($info['content']); ?></textarea>
                                </div>
                            </div>


                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">编辑
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="/assets/store/plugins/kindeditor/kindeditor-min.js"></script>
<script src="/assets/store/plugins/kindeditor/lang/zh_CN.js"></script>
<script src="/assets/store/plugins/tagsinput/amazeui.tagsinput.min.js"></script>
<script>
    $(function () {
        //$('#tags-1').tagsinput('add', '联赛');
        var editor = KindEditor.create('#container' , TEXT_EDITOR_CONFIG);//内容框

        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm({
            // form data
            buildData: function () {
                return {
                    doc: {
                        tags: $('#tags-1').val()
                    }
                };
            },
            // 自定义验证
            validation: function () {
                
                return true;
            }
        });

    });
</script>
